﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace TaxiDispatchClient
{
    public partial class ListOfCarForm : DevExpress.XtraEditors.XtraForm
    {
        public ListOfCarForm(DataTable dt)
        {
            InitializeComponent();
            gridControl1.DataSource = dt;
            gridView1.GroupPanelText = "空车列表  共" + dt.Rows.Count + "辆";
        }

        public DataRow SelectedRow;

        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            if (row!=null)
            {
                SelectedRow = row;
                this.DialogResult = DialogResult.Yes;
                Close();
            }
            else
            {
                this.DialogResult = DialogResult.No;                
            }
        }
    }
}